﻿<Window x:Class="System.Net.XMPP.LoginWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    WindowStartupLocation="CenterScreen"
    Title="Enter Credentials" Loaded="Window_Loaded"
    SizeToContent="WidthAndHeight"
    mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" >
  
    <Window.Resources>

        <SolidColorBrush x:Key="ButtonBrush" Color="#AAEEFFEE" />

        <Style x:Key="ButtonSurface" TargetType="{x:Type Button}">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Background" Value="{DynamicResource ButtonBrush}" />
            <Setter Property="BorderBrush" Value="{x:Null}" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Label Width="100">Accounts</Label>
            <ComboBox Width="150" x:Name="ComboBoxAccounts" SelectionChanged="ComboBoxAccounts_SelectionChanged"  />
            <Button Style="{StaticResource ButtonSurface}" Width="100"  Content="Add" x:Name="ButtonAddAccount" Click="ButtonAddAccount_Click" />
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Label Width="100">AccountName</Label>
            <TextBox Width="150" x:Name="TextBoxAccountName" LostFocus="TextBoxAccountName_LostFocus" Text="{Binding AccountName}" TextChanged="TextBoxAccountName_TextChanged"></TextBox>
        </StackPanel>
        <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Label Width="100">User Name</Label>
                <TextBox Width="150" x:Name="TextBoxUserName" Text="{Binding User}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="3" Orientation="Horizontal">
                <Label Width="100">Password</Label>
            <PasswordBox Width="150" x:Name="TextBoxPassword" PasswordChanged="TextBoxPassword_PasswordChanged"></PasswordBox>
            </StackPanel>
        <StackPanel Grid.Row="4" Orientation="Horizontal">
                <Label Width="100">Domain</Label>
                <TextBox Width="150" x:Name="TextBoxDomain" Text="{Binding Domain}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="5" Orientation="Horizontal">
                <Label Width="100">Server</Label>
                <TextBox Width="150" x:Name="TextBoxServer" Text="{Binding Server}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="6" Orientation="Horizontal">
                <Label Width="100">Port</Label>
                <TextBox Width="150" x:Name="TextBoxPort" Text="{Binding Port}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="7" Orientation="Horizontal">
                <Label Width="100">Resource</Label>
                <TextBox Width="150" x:Name="TextBoxResource" Text="{Binding Resource}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="8" Orientation="Horizontal">
                <CheckBox Width="100" Margin="10,5" Background="White" Foreground="Black" IsChecked="{Binding UseTLSMethod}">Use TLS</CheckBox>
                <CheckBox Width="100" Margin="10,5" Background="White" Foreground="Black" IsChecked="{Binding UseOldSSLMethod}">Use Old TLS Method</CheckBox>
            </StackPanel>
        <StackPanel Grid.Row="9" Orientation="Horizontal">
                <CheckBox Margin="10,5" Background="White" Foreground="Black" IsChecked="{Binding UseSOCKSProxy}">Use Proxy Server</CheckBox>
            </StackPanel>
        <StackPanel Grid.Row="10" Orientation="Horizontal">
                <Label Width="100">Proxy Host</Label>
                <TextBox Width="150" Text="{Binding ProxyName}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="11" Orientation="Horizontal">
                <Label Width="100">Proxy Port</Label>
                <TextBox Width="150" Text="{Binding ProxyPort}"></TextBox>
            </StackPanel>
        <StackPanel Grid.Row="12" Orientation="Horizontal">
                <Label Width="100">SOCKS Version</Label>
                <TextBox Width="150" Text="{Binding SOCKSVersion}"></TextBox>
            <Button HorizontalAlignment="Right" IsDefault="True" Click="SurfaceButton_Click">Login</Button>
        </StackPanel>

        </Grid>    
</Window>
